package cn.itcast.nems.payment.constant;

import lombok.Getter;

@Getter
public enum PaymentSyncStateEnum {
    OTHER(0, "其他异常"),
    SUCCESS(1, "成功"),
    NO_STUDENT_RECORD(2, "不存学籍"),
    MANY_STUDENT_RECORD(3, "存在多个学籍"),
    MANY_ORDER_PAYMENT(4, "存在重复流水"),
    ELIMINATE_DIFF(5,"消除差异")
    ;

    PaymentSyncStateEnum(Integer enumKey, String enumValue) {
        this.enumKey = enumKey;
        this.enumValue = enumValue;
    }

    private final Integer enumKey;

    private final String enumValue;

    public static String getValueByKey(Integer enumKey) {
        PaymentSyncStateEnum[] enums = values();
        for (PaymentSyncStateEnum contractStatusEnum : enums) {
            if (contractStatusEnum.getEnumKey().equals(enumKey)) {
                return contractStatusEnum.getEnumValue();
            }
        }
        return null;
    }
}
